﻿
/*


using System.Drawing;
namespace CrazyCoder.Common.Decode
    {
        public class GanjiImageDecode : CrazyCoder.Common.Decode.ImageDeCodeBase
        {
            public GanjiImageDecode(Bitmap pic) : base(pic) { }
            public GanjiImageDecode(string path) : base(path) { }

            //特征码数组
            string[] CodeArray = new string[] {
"00011111000001111111000111000111001100000110110000000111100000001111000000011110000000111100000001101100000110011100011100011111110000011111000",//0
"0111111110110011001100110011001100110011001100110011",//1
"001111100011111110110000111000000011000000011000000110000001110000111000001110000011000000110000000111111111111111111",//2
"001111100011111110110000111000000011000000011000000111000011110000011110000000111000000011110000111011111110001111100",//3
"00000011100000000111000000011110000001101100000110011000011000110001100001100111000011001111111111111111111111000000011000000000110000000001100",//4
"111111110111111110110000000110000000110000000111111000000001110000000111000000011000000011010000111111111110011111100",//5
"0001111000001111111001110001000110000000110000000011001111001111111110111000011111000000110110000011011100011100111111100001111100",//6
"11111111111111110000011000001100000011000001100000110000001100000010000001100000011000000110000001100000",//7
"001111100011111110111000111110000011111000111011111110011111110111000111110000011110000011111000111011111110001111100",//8
"0011111000011111110011100011101100000110110000011111100011110111111011001111001100000000110000000110001000111001111111000011111000",//9
"11111111"//-
        };
            public Bitmap[] GetPic()
            {
                ToGrayByPixels(); //灰度处理
                Bitmap bmp = GetPicValidByValue(128);
                Bitmap[] pics = GetSplitPics2(bmp, 128);   //分割
                for (int i = 0; i < pics.Length; i++)
                {
                    if (pics[i] != null)
                    {
                        Bitmap b = pics[i];
                        pics[i] = GetPicValidByValue(pics[i], 128);
                        b.Dispose();
                    }
                }
                return pics;
            }
            public string GetCodeString()
            {
                Bitmap[] pics = GetPic();
                string numStr = "";
                for (int i = 0; i < pics.Length; i++)
                {
                    string str = GanjiImageDecode.GetSingleBmpCode(pics[i], 128);
                    for (int j = 0; j < CodeArray.Length; j++)
                    {
                        if (CodeArray[j] == str)
                        {
                            if (j < CodeArray.Length - 1)
                            {
                                numStr += j.ToString();
                            }
                            else
                            {
                                numStr += "-";
                            }
                        }
                    }
                }
                return numStr;
            }
        }
    }
 

*/

